package com.ayitubie.refuelweb.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ayitubie.refuelcommon.entity.GasStationForMap;
import com.ayitubie.refuelcommon.service.gasStationMapServ;
import com.ayitubie.refuelweb.config.interceptor.loginUserInterceptor.UserContext;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/refuel")
public class baiduMapCtl {
    @Reference(loadbalance = "roundrobin")
    gasStationMapServ gasStationMapServ;

    @ResponseBody
    @GetMapping("/query/instation")
    public List<GasStationForMap> getList() {
        int userId = UserContext.getUser().getUserId();
        List<GasStationForMap> gasStations = gasStationMapServ.getGasStrionsForMap(userId);
        return gasStations;
    }
}
